package multiplex.dataaccess;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConnectionFactory {
	
	private static String stringConexao = "jdbc:mysql://localhost:3306/multiplexcinema";
	private static String usuario = "java";
	private static String senha = "java";
	
	/**
	 * retorna uma conexão para que um Dao possa se conectar ao banco
	 * @throws SQLException
	 * @throws ClassNotFoundException
	 */
	public static Connection getConnection() throws SQLException, ClassNotFoundException {
		Class.forName("com.mysql.jdbc.Driver");
		return DriverManager.getConnection(stringConexao, usuario, senha);
	}

}